package com.lyf.boot.modules.system.entity.dto;

import com.lyf.boot.base.system.entity.SysRole;
import com.lyf.boot.validate.group.AddGroup;
import com.lyf.boot.validate.group.EditGroup;
import io.github.linpeilie.annotations.AutoMapper;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

import java.io.Serial;
import java.io.Serializable;

/**
 * @author Luyufan
 * @date 2023/8/14 16:05
 */
@Data
@AutoMapper(target = SysRole.class)
public class SysRoleDto implements Serializable {

    @Serial
    private static final long serialVersionUID = -9207487022220983690L;

    /**
     * 角色id
     */
    @NotNull(message = "角色id不能为空", groups = { EditGroup.class})
    private Long roleId;

    /**
     * 角色编码
     */
    @NotBlank(message = "角色编码不能为空", groups = { AddGroup.class, EditGroup.class})
    private String roleCode;

    /**
     * 角色名称
     */
    @NotBlank(message = "角色编码不能为空", groups = { AddGroup.class, EditGroup.class})
    private String roleName;

    /**
     * 状态
     */
    @NotNull(message = "角色id不能为空", groups = { AddGroup.class, EditGroup.class})
    @Range(min = 0, max = 1, message = "状态取值不正确", groups = { AddGroup.class, EditGroup.class})
    private Integer status;

    /**
     * 排序号
     */
    private Integer sort;

    /**
     * 备注
     */
    private String remark;

}
